﻿using System;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ComponentModel;

namespace Interscape.TwilioClient.Components
{

    /// <summary>
    /// A paged collection of <see cref="OutgoingCallerId">OutgoingCallerId</see> objects.
    /// </summary>
    [Serializable]
    [XmlRoot("OutgoingCallerIds")]
    public class OutgoingCallerIdList : PagedList<OutgoingCallerId>
    {
    }

    /// <summary>
    /// An OutgoingCallerId resource represents an outgoing Caller ID that you have registered with Twilio for use when making an outgoing call or using the Dial verb. 
    /// </summary>
    /// <remarks>This resource leverages PostArguments when adding a new resource to Twilio. See OutgoingCallManager.Add for more information.</remarks>
    [Serializable]
    public class OutgoingCallerId : BaseFriendlyNameInfo
    {

        #region Constructors

        /// <summary>
        /// Creates a new instance of the OutgoingCallerId object.
        /// </summary>
        public OutgoingCallerId() : base()
        {
        }

        /// <summary>
        /// Creates a new instance of the OutgoingCallerId object.
        /// </summary>
        /// <param name="sid">A 34 character string that uniquely identifies this resource.</param>
        public OutgoingCallerId(string sid) : base(sid)
        {
        }

        /// <summary>
        /// Creates a new instance of the OutgoingCallerId object.
        /// </summary>
        /// <param name="sid">A 34 character string that uniquely identifies this resource.</param>
        /// <param name="friendlyName">A human readable descriptive text for this resource, up to 64 characters long.</param>
        public OutgoingCallerId(string sid, string friendlyName) : base(sid, friendlyName)
        {
        }

        #endregion

        /// <summary>
        /// The 10 digit phone number, but you can specify it in any readable format, such as 415-555-1212 or (415) 555.1212 or 1-415-555-1212
        /// </summary>
        [XmlElement]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// The 6 digit validation code that must be entered via the phone to validate this phone number for Caller ID.
        /// </summary>
        [XmlElement]
        [DefaultValue(0)]
        public Int32 ValidationCode { get; set; }

    }
}
